<!DOCTYPE html>
<html lang="zh-cn">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title></title>
		<link rel="stylesheet" href="css/pintuer.css">
		<link rel="stylesheet" href="css/admin.css">
		<link rel="stylesheet" type="text/css" href="../../css/public/bootstrap.min.css" />
		<script src="js/jquery.js"></script>
		<script src="js/pintuer.js"></script>
	</head>

	<body>
		<div class="panel admin-panel">
			<div class="panel-head"><strong class="icon-reorder"> 店铺列表</strong>
				<a href="" style="float:right; display:none;">添加字段</a>
			</div>
			<table class="table table-hover text-center" id="goodsList">
				<tr>
					<th width="100" style="text-align:left; padding-left:20px;">产品名称</th>
					<th width="10%">产品图片</th>
					<th>产品数量</th>
					<th>用户昵称</th>
					<th>联系电话</th>
					<th>收货地址</th>
					<th>用户评价</th>
					<th width="200">操作</th>
				</tr>
				<volist name="list" id="vo">
					<!--<tr>
						<td style="text-align:left; padding-left:20px;"> 1</td>
						<td width="10%"><img src="images/11.jpg" alt="" width="70" height="50" /></td>
						<td></td>
						<td>
							<font color="#00CC99">首页</font>
						</td>
						<td>产品分类</td>
						<td>2016-07-01</td>
						<td>
							<div class="button-group">
								<a class="button border-red" href="javascript:void(0)" onclick="return del(1,1,1)"><span class="icon-trash-o"></span> 删除</a>
							</div>
						</td>
					</tr>-->
			</table>
		</div>
		<!--</form>-->

		<script type="text/javascript">
		
			$.ajax({
				type: "post",
				url: "http://115.28.227.1/projects/xa/php/php08/Back/backCommon.php",
				async: true,
				data: {
					type: "payuser",
					a:"a",
					Did : localStorage.getItem("DID")
				},
				success: function(res) {

					console.log(res);

					for(var i = 0; i < res.length; i++) {
						$('#goodsList').append('<tr id="'+res[i].ID+'">'+
						'<td style="text-align:left; padding-left:20px;" class="storename">'+res[i].GoodName+'</td>'+
						'<td width="10%"><img src="'+JSON.parse(res[i].GoodInfo).firstImg+'" alt="" width="70" height="50" /></td>'+
						'<td>'+res[i].Num+'</td>'+
						'<td>'+res[i].NickName+'</td>'+
						'<td class="hot">'+res[i].Tel+'</td>'+
						'<td class="chose">'+res[i].Address+'</td>'+
						'<td class="chose">'+res[i].view+'</td>'+
						'<td>'+
								'<button class="btn btn-danger shopDeletes" >删除</button>'+
						'</td>'+
					'</tr>')
					}
					$('.shopDeletes').click(function(){
//						var name=$(this).parent().prevAll().eq(5).text();	
						 var r=confirm('确认删除？');
						 
   						if (r==true){
//							$('#'+$(this).parent().parent()[0].id).remove();
   							$(this).parent().parent().remove();
//							console.log($(this).parent().parent().remove());

   							$.ajax({
							type:"post",
							url:"http://115.28.227.1/projects/xa/php/php08/Back/backCommon.php",
							async:true,
							data:{
								type:'payuser',
								a:'aa',
								Cid:$(this).parent().parent()[0].id
							},
							success:function(res){		
									if(res.err==0){
										alert(' 删除成功')
									}
							}
						});
   						}	
					})
				}
			});
		</script>

	</body>

</html>